﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Shakes_and_Fidget_Charplaner
{
	public class Item
	{
		public Enums.Slot slot;
		public int look;
		public int extra1;
		public int extra2;
		public Attribute atr1;
		public Attribute atr2;
		public Attribute atr3;

		public Item(Attribute a1, Attribute a2, Attribute a3, Enums.Slot slot, int look = 0, int extra1 = 0, int extra2 = 0)
		{
			this.atr1 = a1;
			this.atr2 = a2;
			this.atr3 = a3;
			this.slot = slot;
			this.look = look;
			this.extra1 = extra1;
			this.extra2 = extra2;
		}
		public Item()
		{ }

		public int GetArmor()
		{
			if (this.HasArmor())
				return this.extra1; // Armor
			return 0;
		}
		public int GetBlockRate()
		{
			if (this.slot == Enums.Slot.SHIELD)
				return this.extra1; // Block Rate
			return 0;
		}
		public int[] GetWeaponDamage()
		{
			if (this.slot == Enums.Slot.WEAPON)
				return new int[] { this.extra1, this.extra2 };
			return new int[] { 0, 0 };
		}
		bool HasArmor()
		{
			if (this.slot == Enums.Slot.BELT || this.slot == Enums.Slot.BREAST || this.slot == Enums.Slot.FEET || this.slot == Enums.Slot.HANDS || this.slot == Enums.Slot.HELMET)
				return true;
			return false;
		}
	}
}
